﻿using System;
using System.Globalization;
using Avalonia.Data.Converters;

namespace WeatherCore.App.Converter;

public class ImageConverter : IValueConverter
{
    public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        if (value is string s)
            return $"avares://WeatherCore.App/Assets/WeatherIcon/{s}.svg";
        return value;
    }

    public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        return value;
    }
}